using Godot;
using System;

public partial class FactionItem : MarginContainer
{
  Control _outline;

  TextureButton _button;

  public override void _Ready()
  {
    _outline = GetNode<Control>("NinePatchRect");
    _button = GetNode<TextureButton>("TextureButton");
    _button.Pressed += OnButtonClick;
  }

  private void OnButtonClick()
  {
    foreach (var item in GetParent().GetChildren())
    {
      item.Call("Reset");
    }
    Check();
  }

  public void Check()
  {
    _outline.Show();
  }

  public void Reset()
  {
    _outline.Hide();
  }

}
